<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>考试科目管理 - 专业挖掘机培训系统</title>
    <link href="static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css" />
    <link href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
    <style>
         :root {
            --primary-color: #1890ff;
            --success-color: #52c41a;
            --warning-color: #faad14;
            --danger-color: #ff4d4f;
            --text-color: #333333;
            --border-radius: 4px;
            --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
            background: #f0f2f5;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            color: var(--text-color);
            line-height: 1.5;
        }
        
        .nav {
            background: #fff;
            box-shadow: var(--box-shadow);
            padding: 0 24px;
            position: sticky;
            top: 0;
            z-index: 1000;
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 64px;
        }
        
        .logo {
            color: var(--primary-color);
            font-size: 18px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .logo i {
            font-size: 24px;
        }
        
        .nav-links {
            display: flex;
            gap: 8px;
        }
        
        .nav-links a {
            color: var(--text-color);
            text-decoration: none;
            padding: 8px 16px;
            border-radius: var(--border-radius);
            transition: all 0.3s;
        }
        
        .nav-links a:hover {
            color: var(--primary-color);
            background: rgba(24, 144, 255, 0.1);
        }
        
        .nav-links a.active {
            color: var(--primary-color);
            background: rgba(24, 144, 255, 0.1);
            font-weight: 500;
        }
        
        .page-container {
            flex: 1;
            padding: 24px;
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
        }
        
        .operation-btns {
            background: #fff;
            padding: 16px;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            margin-bottom: 24px;
            display: flex;
            gap: 16px;
            align-items: center;
        }
        
        .btn {
            height: 32px;
            padding: 0 16px;
            border-radius: var(--border-radius);
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.3s;
            border: none;
            cursor: pointer;
        }
        
        .btn-primary {
            background: var(--primary-color);
            color: #fff;
        }
        
        .btn-primary:hover {
            background: #40a9ff;
            transform: translateY(-1px);
        }
        
        .btn-success {
            background: var(--success-color);
            color: #fff;
        }
        
        .btn-success:hover {
            background: #73d13d;
            transform: translateY(-1px);
        }
        
        .input-text {
            height: 32px;
            padding: 4px 11px;
            border: 1px solid #d9d9d9;
            border-radius: var(--border-radius);
            transition: all 0.3s;
            width: 200px;
        }
        
        .input-text:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
            outline: none;
        }
        
        .table {
            background: #fff;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }
        
        .table th {
            background: #fafafa;
            color: rgba(0, 0, 0, 0.85);
            font-weight: 500;
            padding: 16px;
            text-align: left;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .table td {
            padding: 16px;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .table tr:hover {
            background: #fafafa;
        }
        
        .modal-content {
            border-radius: 8px;
            box-shadow: 0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08);
        }
        
        .modal-header {
            padding: 16px 24px;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .modal-title {
            font-size: 16px;
            font-weight: 500;
            color: rgba(0, 0, 0, 0.85);
            margin: 0;
        }
        
        .modal-body {
            padding: 24px;
        }
        
        .select {
            width: 100%;
            height: 32px;
            padding: 4px 11px;
            border: 1px solid #d9d9d9;
            border-radius: var(--border-radius);
            transition: all 0.3s;
        }
        
        .select:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
            outline: none;
        }
        
        .footer {
            background: #fff;
            padding: 24px;
            text-align: center;
            color: rgba(0, 0, 0, 0.45);
            box-shadow: 0 -1px 0 0 #f0f0f0;
        }
        
        .footer p {
            margin: 0;
            line-height: 1.5;
        }
        
        @media (max-width: 768px) {
            .page-container {
                padding: 16px;
            }
            .operation-btns {
                flex-direction: column;
                align-items: stretch;
            }
            .input-text {
                width: 100%;
            }
        }
    </style>
</head>

<body>
    <nav class="nav">
        <div class="logo">
            <i class="fas fa-truck-monster"></i> 专业挖掘机培训
        </div>
        <div class="nav-links">
            <a href="adminindex.html">
                <i class="fas fa-home"></i> 首页
            </a>
            <a href="member.html">
                <i class="fas fa-users"></i> 学员管理
            </a>
            <a href="score.html">
                <i class="fas fa-graduation-cap"></i> 成绩管理
            </a>
            <a href="subject.html" class="active">
                <i class="fas fa-tasks"></i> 考试管理
            </a>
            <a href="/logout">
                <i class="fas fa-sign-out-alt"></i> 退出登录
            </a>
        </div>
    </nav>

    <div class="page-container">
        <div class="operation-btns">
            <button class="btn btn-primary" onclick="addSubject()">
                <i class="fas fa-plus"></i> 安排考试
            </button>
            <input type="text" class="input-text" placeholder="输入考生姓名搜索" id="searchInput">
            <button class="btn btn-success" onclick="searchSubject()">
                <i class="fas fa-search"></i> 搜索
            </button>
        </div>

        <table class="table">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>科目名称</th>
                    <th>考试时间</th>
                    <th>考生姓名</th>
                    <th>考场号</th>
                    <th>考生手机号</th>
                    <th>身份证号码</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody id="subjectList">
                <!-- 数据将通过AJAX动态加载 -->
            </tbody>
        </table>
    </div>

    <footer class="footer">
        <p>©2024 专业挖掘机培训系统 版权所有</p>
        <p>地址：郑州市新郑市龙湖镇教育园区 | 联系电话：400-888-8888</p>
    </footer>

    <script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
    <script>
        // 获取考试安排列表
        function getSubjectList() {
            $.ajax({
                url: '/api/subjects',
                method: 'GET',
                success: function(res) {
                    // 处理返回数据，渲染表格
                }
            });
        }

        // 添加考试安排 - 打开新窗口
        function addSubject() {
            const width = 500;
            const height = 700;
            const left = (window.screen.width - width) / 2;
            const top = (window.screen.height - height) / 2;

            window.open('subject-add.html', 'addSubject',
                `width=${width},
                 height=${height},
                 left=${left},
                 top=${top},
                 toolbar=no,
                 menubar=no,
                 scrollbars=yes,
                 resizable=no,
                 location=no,
                 status=no`
            );
        }

        // 保存考试安排
        function saveSubject() {
            const formData = $('#subjectForm').serialize();
            $.ajax({
                url: '/api/subjects',
                method: 'POST',
                data: formData,
                success: function(res) {
                    $('#subjectModal').modal('hide');
                    getSubjectList();
                }
            });
        }

        // 搜索考试安排
        function searchSubject() {
            const keyword = $('#searchInput').val();
            $.ajax({
                url: '/api/subjects/search',
                method: 'GET',
                data: {
                    keyword
                },
                success: function(res) {
                    // 处理搜索结果
                }
            });
        }
    </script>
</body>

</html>